package com.jqq.homework;

/**
 * @author 姬倩倩
 * @version 1.0
 */
public class Homework08 {
    public static void main(String[] args) {
        Color[] colors = Color.values();
        System.out.println("颜色\t\tredValue\tgreenValue\tblueValue");
        System.out.println("=========================================");
        for (Color color : colors) {
            switch (color) {
                case RED:
                    System.out.println("红色\t\t" + color.show());
                    break;
                case BLUE:
                    System.out.println("蓝色\t\t" + color.show());
                    break;
                case BLACK:
                    System.out.println("黑色\t\t" + color.show());
                    break;
                case YELLOW:
                    System.out.println("黄色\t\t" + color.show());
                    break;
                case GREEN:
                    System.out.println("绿色\t\t" + color.show());
                    break;
            }
        }
        System.out.println("=========================================");
    }
}

interface showColor {
    String show();
}

enum Color implements showColor {
    RED(255, 0, 0),
    BLUE(0, 0, 255),
    BLACK(0, 0, 0),
    YELLOW(255, 255, 0),
    GREEN(0, 255, 0),
    ;
    private final int redValue;
    private final int greenValue;
    private final int blueValue;

    Color(int redValue, int greenValue, int blueValue) {
        this.redValue = redValue;
        this.greenValue = greenValue;
        this.blueValue = blueValue;
    }

    @Override
    public String show() {
        return redValue +"\t\t\t" + greenValue +"\t\t\t" + blueValue ;

    }
}